#ifndef I2C_H_
#define I2C_H_

#include <android/log.h>

#include <stdint.h>

#include <errno.h>
#include <stdio.h>
#include <string.h>
#include <unistd.h>
#include <fcntl.h>
#include <unistd.h>
#include <linux/i2c-dev.h>


#define TAG "MyJNITag" // 自定义日志标签
#define LOGD(...) __android_log_print(ANDROID_LOG_DEBUG, TAG, __VA_ARGS__)

/**
 * data
**/
#define UBYTE   uint8_t
#define UWORD   uint16_t
#define UDOUBLE uint32_t



/*-------------------------------------------------*/
void DEV_ModuleInit(char *path);

void DEV_Delay_ms(UDOUBLE xms);

void DEV_I2C_Set_SlaveAddress(uint8_t Add);
void I2C_Write_Byte(uint8_t Cmd, uint8_t value);
void I2C_Write_NByte(uint8_t *Cmd, uint8_t num);
int I2C_Read_Byte(uint8_t Cmd);
int I2C_Read_Word(uint8_t Cmd);
void I2C_Read_NByte(uint8_t Cmd, uint8_t *rbuf, uint8_t num);


#endif